use crate::global_var;
use crate::service;

use global_var::GLOBAL_POOL;
use service::{DataItemService, SettingsService};

pub fn create_data_item_service() -> DataItemService {
    let data_item_service = DataItemService::new(GLOBAL_POOL.clone());
    data_item_service.init_table().unwrap();
    data_item_service
}

pub fn create_settings_service() -> SettingsService {
    let settings_service = SettingsService::new(GLOBAL_POOL.clone());
    settings_service.init_table().unwrap();
    settings_service
}
